package com.bryantkobe.myspringcode.controller;

import com.bryantkobe.myspringcode.service.IServerlogService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @description: 接收keepalived消息Controller
 * @author: alienwarezzl
 * @date: 2025/9/14
 */
@RestController
@RequestMapping("/keepalived")
@Tag(name = "keepalived模块",description = "用于接收keepalived相关消息模块")
public class KeepalivedController {
    private static final Logger log = LoggerFactory.getLogger(KeepalivedController.class);

    @Resource
    private IServerlogService iServerlogService;

    @Operation(summary = "/notionMessage",description = "接收keepalived消息")
    @PostMapping("/notionMessage")
    public void  notionMessage(String message){
        log.error(message);
        iServerlogService.savekeepalivedMessage(message);
    }
}
